home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 089a.dms / 089a.adf / TEXTS / CHAPTERS_21-30 / chapter30.txt < prev    next >
Text File  |  1992-02-26  |  4KB  |  110 lines

  1.  
  2.                      The Absolute Beginners Guide To Amos
  3.                     -------------------------------------
  4.                                 Chapter Thirty
  5.                               ------------------
  6. In chapter 26 I showed you how to execute Amigados programs from within
  7. Amos.  In this chapter we will take things one step further and actually
  8. integrate the executable program in our Amos listing.  This will have
  9. the advantages of not having to load the program from disk and 
  10. means your program will all be in one neat Amos program. 
  11. Another benefit is that you won't need to make sure the program is available
  12. to your Amos code as it will be inside it already.
  13.  
  14. I will show you how to solve the problem of neatly displaying
  15. text files, such as program instructions, using the PD utility PPMore.
  16. The author of PPMore (Nico Francois) has done all the hard work for us,
  17. all we need to do is pass a text file to it to display.
  18.  
  19. If we were using PPMore from Workbenche's CLI and we wanted to display a
  20. text file called readme.doc,  we would use the following:
  21.  
  22. PPMore readme.doc
  23.  
  24. And this would run PPMore and it would automatically load and display the
  25. readme.doc.
  26.  
  27. So, first of all how do we get PPMore to be INSIDE our Amos code?
  28. We just load it into an Amos bank of course. Here is how to do it:
  29.                    ---------------------------------------
  30.  
  31. Load up Amos
  32.  
  33. Go into DIRECT MODE (Press Escape)
  34.  
  35. Type in the following:
  36. ----------------------
  37. Reserve as Chip Data 10,7180   ;Reserve the EXACT amount of bytes used by
  38.                                 the program you want to load in. Note
  39.                                 check the size yourself as this is a 
  40.                                 crunched ppmore I am using. 
  41.  
  42. Bload "SYS:c/PPmore",10        ; Bload the program into a bank.
  43.  
  44.  
  45. Now PPmore is stored in bank 10, when you save off the Amos program, 
  46. bank 10 will be saved with it.
  47.  
  48.  
  49. A few notes:
  50.  
  51. As mentioned you must reserve the EXACT amout of bytes of PPMore, this
  52. will depend on the version of PPMore you are going to load and wether it is 
  53. crunched or not. You can find the size by doing a DIR in direct mode.
  54.  
  55. When you do the Bload, you will have to specify the correct path. 
  56. If you are not sure, copy PPMore to the Ram disk and use:
  57. Bload "Ram:PPmore",10   
  58.  
  59. PPMore should now be loaded into bank 10. To check this type LISTBANK.
  60.  
  61. Going back to the editor (press escape) type this in as the first line of
  62. your program:
  63.  
  64. Bsave "ram:ppmore",Start(10) To Start(10)+Length(10)
  65.  
  66. This puts PPmore into the Ram disk ready for use each time the Amos program
  67. is run.
  68.  
  69. Now we need a text file for PPmore to display, this could be the
  70. instructions to your program. For this example we will assume we
  71. have the file readme.doc on the disk in DF0:
  72.  
  73. Amos To Back 
  74. COMMAND$="ram:ppmore DF0:Readme.doc"
  75. Dreg(1)=Varptr(COMMAND$)
  76. Dreg(2)=0
  77. Dreg(3)=0
  78. XEXECUTE=Doscall(-222)
  79. Amos To Front 
  80.  
  81. All the above lines were covered in chapter 26. The only difference being
  82. the contents of COMMAND$.
  83.  
  84. When you run this Amos will disappear and PPmore will open itself on the
  85. Workbench screen and load up "readme.doc".
  86. The user can now use PPmore as usual to read your instructions.
  87.  
  88. When the user quits PPmore he will be magically transported back to Amos 
  89. where your program can contine executing as normal.
  90.  
  91. You can do this with virtually ANY program you want, which makes Amos 
  92. extremely flexible, the mind boggles at what you can get up to.
  93.  
  94. Some notes about PPmore:
  95.  
  96.  * You will need Powerpacker.Library in Libs of Sys: (The disk booted from)
  97.  * If you want the PRINT option to work you will have to set up the printer
  98.    driver etc. on the boot disk.
  99.  
  100. Take a look at Example30.Amos which is set up to read the Help.txt text file
  101. from this disk. Press escape when you want to return back to Amos.
  102. I would suggest giving the author of any program you use a thankyou message
  103. inside your program, and only use PD programs.
  104.  
  105. No excuses for shabby doc displayers anymore.
  106.  
  107.                             End of chapter Thirty
  108.                             ^^^^^^^^^^^^^^^^^^^^^
  109.  
  110.